package com.mytest.service;

import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

@Service
public class MyService {

    private static final Logger logger = LoggerFactory.getLogger(MyService.class);
    @Autowired
    HomeService homeService;

    public synchronized void method(String string){

        logger.info("my service method");
        try {
            Thread.sleep(30000);
        } catch (InterruptedException e) {
            e.printStackTrace();
        }
        if ("false".equals(string)){
            homeService.method(string);
        }

    }


}
